package com.immersiondemo;

import android.content.Context;
import android.os.Build;

/**
 * @author wenwang.liu
 *         create by 2019/2/26 17:24.
 *         小米8.0和9.0的刘海屏适配方式不一样
 */

public class XiaomiBrand implements PhoneBrand {
    @Override
    public boolean hasNotchInXiaomi(Context context) {
        boolean has=false;
        if(Build.VERSION.SDK_INT == Build.VERSION_CODES.O){//8.0刘海屏api
            has=SystemPropertiesProxy.getInt(context,"ro.miui.notch", 0)==1;
        }else if(Build.VERSION.SDK_INT == Build.VERSION_CODES.P) {//9.0刘海屏api

        }
        return has;
    }

    @Override
    public int[] getNotchSize(Context context) {
        return new int[0];
    }

//    public static boolean hasNotchInXiaomi(Context context){
//        return SystemPropertiesProxy.getInt(context,"ro.miui.notch", 0)==1;
//    }
}
